backend = "etcdv3"
nodes = [
{% if not dcs_exists|bool %}
  {% for host in groups['etcd_cluster'] %}
  "{{ patroni_etcd_protocol | default('http', true) }}://{{ hostvars[host]['etcd_bind_address'] | default(hostvars[host]['bind_address'], true) }}:2379",
  {% endfor %}
{% endif %}
{% if dcs_exists|bool %}
  {% for etcd_hosts in patroni_etcd_hosts %}
  "{{ patroni_etcd_protocol | default('http', true) }}://{{etcd_hosts.host}}:{{etcd_hosts.port}}",
  {% endfor %}
{% endif %}
]
{% if etcd_tls_enable | default(false) | bool %}
scheme = "https"
client_cakeys = "{{ confd_etcd_tls_dir | default('/etc/confd/tls/etcd') }}/{{ confd_etcd_client_cakey | default('ca.crt') }}"
client_cert = "{{ confd_etcd_tls_dir | default('/etc/confd/tls/etcd') }}/{{ confd_etcd_client_cert | default('server.crt') }}"
client_key = "{{ confd_etcd_tls_dir | default('/etc/confd/tls/etcd') }}/{{ confd_etcd_client_key | default('server.key') }}"
{% endif %}
{% if patroni_etcd_username | default('') | length > 0 %}
basic_auth = true
username = "{{ patroni_etcd_username | default('') }}"
password = "{{ patroni_etcd_password | default('') }}"
{% endif %}
watch = true
interval = 10
